﻿
namespace EasyComm
{
    public enum ChangeType
    {
        NotChanged = 0,
        Added = 1,
        Removed = 2,
        Modified = 3,
        RemovedAll = 4
    }

    public delegate void ThreadSafeCollectionChangeEventHandler<T>(object sender, ThreadSafeCollectionEventArgs<T> e) where T : class;

    public class ThreadSafeCollectionEventArgs<T> where T : class
    {
        public ChangeType ChangeType { get; private set; }
        public T Item { get; private set; }
        public int Index { get; private set; }

        public ThreadSafeCollectionEventArgs(T item, int index, ChangeType changeType)
        {
            ChangeType = changeType;
            Item = item;
            Index = index;
        }
    }
}
